load("@rules_cc//cc:cc_library.bzl", "cc_library")

cc_library(
    name = "libgit2_hdrs",
    hdrs = glob(["**/*.h"]),
    strip_include_prefix = "/src/libgit2",
    deps = [
        "//deps/xdiff:xdiff_hdrs",
        "//include:git2",
        "//src/util:util_hdrs",
    ],
)

cc_library(
    name = "git2",
    srcs = glob([
        "**/*.c",
        "**/*.h",
    ]),
    implementation_deps = [
        ":libgit2_hdrs",
        "//deps/llhttp",
        "//deps/xdiff",
        "//src/util",
    ],
    visibility = ["//:__subpackages__"],
    deps = ["//include:git2"],
)
